#pragma once
#include "global.h"
#include "IObjectClass.h"
#include "Waves.h"
#include "PeaksValleys.h"

class WavesApp:public IObjectClass
{
public:
	WavesApp();
	~WavesApp();
	virtual void initApp(ID3D10Device* device);
	virtual void onResize(int mClientWidth, int mClientHeight);
	virtual void updateScene(float deltatime, float gametime);
	virtual void Draw();
private:
	void buildRenderStates();
	void buildFX();
	void buildVertexLayouts();
private:
	Waves m_Waves;
	PeaksAndValleys m_peakVallys;

	ID3D10Device *mDevice;
	ID3D10Effect* mFX;
	ID3D10EffectTechnique* mTech;
	ID3D10EffectMatrixVariable* mfxWVPVar;

	ID3D10InputLayout* mVertexLayout;

	D3DXMATRIX mLandWorld;
	D3DXMATRIX mWavesWorld;

	D3DXMATRIX mView;
	D3DXMATRIX mProj;
	D3DXMATRIX mWVP;


	ID3D10RasterizerState* mWireframeRS;

	float mRadius;
	float mTheta;
	float mPhi;
};

